package com.english.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.english.entity.CourseClass;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 课程班级Mapper
 *
 * @author wlq
 * @since 2025-08-06
 */
@Mapper
public interface CourseClassMapper extends BaseMapper<CourseClass> {

    /**
     * 获取所有活跃的班级
     */
    @Select("SELECT * FROM course_class WHERE status = 1 ORDER BY id")
    List<CourseClass> selectActiveClasses();

    /**
     * 根据班级类型获取班级
     */
    @Select("SELECT * FROM course_class WHERE class_type = #{classType} AND status = 1")
    CourseClass selectByClassType(String classType);
} 